<?php
namespace app\console\model;

use think\Model;
use app\console\model\QuotHour as QuotHourModel;
class RushHour extends Model
{
    protected function getQuotNameAttr($value, $data)
    {
        $quot_str = "";
        $find = (new QuotHourModel())->where('id', 'in', $data['rush_id'])->field('name')->select();
        foreach ($find as $v){
            $quot_str.= $v['name']."场次，";
        }
        return $quot_str;
    }

    public function ShopGoods()
    {
        return $this->hasOne('ShopGoods', 'id', 'goods_id')->field('id,title,thumb_img,price');
    }
}